package dialogs;

import java.awt.BorderLayout;
import java.awt.Color;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTextPane;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.StyleConstants;


/**
 *
 * @author Nate
 */
public class Save extends JDialog {

    private final JPanel contentPanel = new JPanel();
    private JTextPane textPane;

    public Save() {
        setTitle("Saved");
        setBounds(100, 100, 350, 100);
        setResizable(false);
        getContentPane().setLayout(new BorderLayout());
        contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
        getContentPane().add(contentPanel, BorderLayout.CENTER);
        contentPanel.setLayout(new BorderLayout(0, 0));
        {
            textPane = new JTextPane();
            setFormat(textPane);
            contentPanel.add(textPane);
        }
    }

    void setFormat(JTextPane textPane) {
        SimpleAttributeSet boldSet = new SimpleAttributeSet();
        StyleConstants.setBold(boldSet, true);
        StyleConstants.setFontSize(boldSet, 18);

        SimpleAttributeSet colorSet = new SimpleAttributeSet();
        StyleConstants.setForeground(colorSet, Color.blue);
        StyleConstants.setFontSize(colorSet, 14);

        SimpleAttributeSet normalSet = new SimpleAttributeSet();
        StyleConstants.setFontSize(normalSet, 12);

        Document doc = textPane.getStyledDocument();

        try {
            //doc.insertString(doc.getLength(), "Help Content:", boldSet);
            StyleConstants.setFontSize(boldSet, 20);

            //doc.insertString(doc.getLength(), "\n\nSomething:", boldSet);
            doc.insertString(doc.getLength(), "And Alex said; \"Let it be saved\" and it was saved.", boldSet);

        } catch (BadLocationException e) {
        }
    }
}
